package com.test.loader;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

import java.io.InputStream;

public class DefaultDocumentLoader implements DocumentLoader{

    /**
     * 从输入流中加载XML文档
     * @param inputStream
     * @return
     * @throws DocumentException
     */
    @Override
    public Document loadDocument(InputStream inputStream) throws DocumentException {
        SAXReader reader = new SAXReader();
        return reader.read(inputStream);
    }
}
